import { EggAppConfig, PowerPartial } from "egg";

export default () => {
  const config: PowerPartial<EggAppConfig> = {};
  config.sequelize = {
    dialect: "mysql",
    host: "127.0.0.1",
    port: 3306,
    database: "mft_development",
    username: "rn_mysql",
    password: "2wsx#EDC",
    timezone: "+08:00",
    pool: {
      max: 40,
      min: 0,
      acquire: 600000,
      idle: 600000
    }
  };
  config.sessionMysql = {
    database: "session",
    host: "127.0.0.1",
    port: 3306,
    user: "rn_mysql",
    password: "2wsx#EDC"
  };
  config.session = {
    maxAge: 2 * 3600 * 1000, // ms
    key: `sid.mf.${process.env.NODE_ENV}`,
    encrypt: true,
    overwrite: true,
    rolling: true
  };

    /*config.sequelize = {
      dialect: "mysql",
      host: "127.0.0.1",
      port: 3306,
      database: "mft_development",
      username: "root",
      password: "123456qq",
      timezone: "+08:00",
      pool: {
        max: 40,
        min: 0,
        acquire: 600000,
        idle: 600000
      }
    };
    config.sessionMysql = {
      database: "session",
      host: "127.0.0.1",
      port: 3306,
      user: "root",
      password: "123456qq"
    };
    config.session = {
      maxAge: 2 * 3600 * 1000, // ms
      key: `sid.mf.${process.env.NODE_ENV}`,
      encrypt: true,
      overwrite: true,
      rolling: true
    };*/
  return config;
};
